import 'package:event_bus/event_bus.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_heating/service/auth_service.dart';

///事件总线
class AppEvent {
  static final AppEvent instance = AppEvent._();
  AppEvent._();
  factory AppEvent() => instance;
  final EventBus eventBus = EventBus();
}

class ThemeChangeEvent {
  ThemeMode themeMode;
  ThemeChangeEvent(this.themeMode);
}

class UserChangeEvent {
  UserData user;
  String action;
  UserChangeEvent(this.user, this.action);
}

///切换主导航索引
class RootSetCurrentTabIndexEvent {
  Uri uri;

  RootSetCurrentTabIndexEvent(this.uri);
}

class RootNavigateChangeEvent {
  int? index;
  String? name;
  bool reClicked;
  String? query;
  RootNavigateChangeEvent({
    this.index,
    this.name,
    this.reClicked = false,
    this.query,
  });
}
